<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>

</head>

<body>
    <div id="root">
        <!-- <h2 v-show="false">欢迎来到{{name}}</h2>
        <h2 v-if="false">欢迎来到{{name}}</h2> -->
        <h2>当前n的值是:{{n}}</h2>
        <button @click="n++">点我n+1</button>
        <div v-show="n===1">1</div>
        <div v-show="n===2">2</div>
        <div v-show="n===3">3</div>

        <template v-if="n===1">
            <h2>1</h2>
            <h2>1</h2>
            <h2>1</h2>
        </template>

    </div>


</body>

</html>
<script>
    new Vue({
        el: '#root',
        data: {
            name: '英雄联盟',
            n: 0
        }
    })

</script>